<template>
	<view style="display: flex;flex-direction: column;align-items: center;">
		<view class="list" v-for="(item,i) in list" :key="item.id" @tap="ondetails(item.id)">
			<view class="top_left">
				<view class="one" v-if="i == 0"
					style="padding-left:8rpx;border-radius: 0 0 0 16rpx;background-color: #FEE378;  display: flex;align-items: center;padding: 2px 5px 2px 0;">
					<image style=" margin: 0 6rpx; width: 20rpx; height: 18rpx;" src="@/static/images/service/champion.png"
						mode=""></image>
					<text>本月服务订单冠军</text>
				</view>
				<view class="two" v-if="i == 1"
					style="padding-left:8rpx;border-radius: 0 0 0 16rpx;background-color: #E2E2E2; display: flex;align-items: center;padding: 2px 5px 2px 0;">
					<image style=" margin: 0 6rpx; width: 20rpx; height: 18rpx;" src="@/static/images/service/second.png" mode="">
					</image>
					<text>本月服务订单亚军</text>
				</view>
				<!-- sdfsf -->
				<view class="three" v-if="i == 2"
					style="padding-left:8rpx;border-radius: 0 0 0 16rpx;background-color: #FCD3A8; display: flex;align-items: center;padding: 2px 5px 2px 0;">
					<image style="  margin: 0 6rpx; width: 20rpx; height: 18rpx;" src="@/static/images/service/runnerUp.png"
						mode=""></image>
					<text>本月服务订单季军</text>
				</view>
			</view>
			<image class="img" :src="$wanlshop.oss(`${ item.avatar_img }`)" mode="aspectFill"></image>
			<view class="text">
				<view class="top">
					<view class="name">
						{{item.name}}
					</view>
					<view class="span" v-if="item.level">
						{{item.level == 4 ? '高级技师' : item.level == 3 ? '中级技师' : item.level == 2 ? '初级技师' : '见习技师'}}
					</view>
					<view class="span" v-if="item.tags">
						{{item.tags}}
					</view>
				</view>
				<view class="bottom">
					<view class="add">
						累计服务{{item.order_num }}单
					</view>
					<view class="appraise">
						评分{{item.score}}
					</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 技师列表
				list: []
			};
		},
		onLoad(option) {
			this.getStaff(option)
		},
		methods: {
			ondetails(id) {
				uni.navigateTo({
					url: `/pages/service/technician/details?id=${id}`
				})
			},
			getStaff(option) {
				console.log('option', option)
				this.$api.get({
					url: '/wanlshop/store/staff?store_id=' + option.ids,
					success: res => {
						this.list = res
						console.log(res, 'staff')
					}
				});
			},
		}

	}
</script>

<style lang="scss">
	page {
		background-color: #f6efe9;
	}

	.top_left {
		font-size: 18rpx;
		position: absolute;
		top: 0;
		right: 0;
	}

	.list {
		width: 714rpx;
		// height: 110rpx;
		display: flex;
		padding: 34rpx 46rpx;
		box-shadow: 0px 0px 8rpx 0px rgba(0, 0, 0, 0.05);
		margin: 10rpx 0;
		position: relative;
		border-radius: 20rpx;
		overflow: hidden;
		background-color: #fff;

		.img {
			width: 110rpx;
			height: 110rpx;
			border-radius: 50%;
		}

		.text {
			margin-left: 30rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-around;

			.top {
				display: flex;
				align-items: center;

				.name {
					font-family: PingFang SC;
					font-size: 30rpx;
					font-weight: normal;
					line-height: normal;
					letter-spacing: 0em;
					font-variation-settings: "opsz" auto;
					color: #3D3D3D;
				}

				.span {
					// width: 36px;
					height: 13px;
					margin-left: 10rpx;
					border: 2rpx solid #FD7601;
					font-family: PingFang SC;
					font-size: 18rpx;
					letter-spacing: 0em;
					font-variation-settings: "opsz" auto;
					/* 品牌色 */
					color: #FD7601;
					display: flex;
					align-items: center;
					justify-content: center;
					padding: 4rpx;
					background-color: #F6EFE9;
					border-radius: 6rpx;
				}

			}

			.bottom {
				font-size: 22rpx;
				font-variation-settings: "opsz" auto;
				color: #3D3D3D;
				display: flex;
				align-items: center;

				.add {
					border-right: 2rpx solid #aaa;
					padding-right: 28rpx;
				}

				.appraise {
					margin-left: 28rpx;
				}
			}
		}
	}
</style>